<template>
    <div>
        <el-form-item v-for='item in options' :key='item.key' :label="item.title"  :prop='item.key'>
            <el-input v-model="form[item.key]" v-if='item.type==="text"' 
                :placeholder=" item.placeholder ? item.placeholder : '请输入' + item.title "  
                clearable :disabled="item.desabled" :size="item.size" :style="{width:item.styleWidth}" />
            <el-select  v-model="form[item.key]" v-if="item.type==='select'"  
                :placeholder=" item.placeholder ? item.placeholder : '请选择' + item.title " 
                clearable :size="item.size"  :style="{width:item.styleWidth}"  >
                    <el-option 
                        v-for='data in  item.option.data' 
                        :key='data[item.option.props.key]' 
                        :label="data[item.option.props.label]" 
                        :value="data[item.option.props.value]" />
            </el-select>
        </el-form-item>

    </div>
</template>
<script>
export default {
    props:{
        //配置
        form:{
            type:Object,
            default:() => {}
        },
        options:{
            type:Array,
            default:() => []
        },
    },
    created(){}
}
</script>
<style scoped>

</style>
